package com.atguigu.spring.aop.impl;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	public static void main(String[] args) {
		//1 创建spring 的ioc容器
		ApplicationContext ctx =new ClassPathXmlApplicationContext("applicationContext.xml");
		//2 从ioc容器获取bean的实例
		ArithMeticCaculator arithMeticCaculator = ctx.getBean(ArithMeticCaculator.class);
		
		//3 使用bean
		int result = arithMeticCaculator.add(2, 4);
		System.out.println(result);
	}
}
